package com.zlm.tools;

import com.zlm.tools.event.RandomEvent;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

import javax.annotation.PostConstruct;
import java.util.Random;

@SpringBootApplication(scanBasePackages = "com.zlm.tools")
@EnableAspectJAutoProxy
public class ToolsApplication {
    @PostConstruct
    public void init() {
        System.out.println("Application 初始化了");

    }
    public static void main(String[] args) {
        System.out.println(1234567890);
        ConfigurableApplicationContext context = SpringApplication.run(ToolsApplication.class, args);
        RandomEvent randomEvent = new RandomEvent(new Random().nextInt() + "事件");
        context.publishEvent(randomEvent);
        System.out.println(23456);
    }

}
